package mi.payment.admin.pay88;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import lainey.ui.widget.TitleView;
import mi.payment.R;
import mi.payment.ui.base.ParentActivity;

public class IPay88MainActivity extends ParentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.admin_pay88_main_activity);
        initView();
    }

    private void initView() {
        TitleView titleView = findViewById(R.id.title_view);
        titleView.setCenterText(R.string.pay88_setting);
        titleView.setLeftImageOnClickListener(
                v -> onBackPressed()
        );

        View item = findViewById(R.id.item_merchant);
        item.findViewById(R.id.left_image).setVisibility(View.GONE);
        item.findViewById(R.id.right_text).setVisibility(View.GONE);
        item.findViewById(R.id.right_image).setVisibility(View.VISIBLE);
        TextView leftText = item.findViewById(R.id.left_text);
        leftText.setText(R.string.pay88_setting_merchant);
        item.setOnClickListener(this);

        item = findViewById(R.id.item_wallet);
        item.findViewById(R.id.left_image).setVisibility(View.GONE);
        item.findViewById(R.id.right_text).setVisibility(View.GONE);
        item.findViewById(R.id.right_image).setVisibility(View.VISIBLE);
        leftText = item.findViewById(R.id.left_text);
        leftText.setText(R.string.pay88_setting_wallet);
        item.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        final int id = v.getId();
        switch (id) {
            case R.id.item_merchant:
                openActivity(IPay88MerchantActivity.class);
                break;
            case R.id.item_wallet:
                openActivity(IPay88WalletActivity.class);
                break;
        }
    }


}
